window.KmlLayer = function(option){
	option = option||{};
	this.url = option.url;
	this.filter = option.filter;
	this.init();
}

window.KmlLayer.prototype = {
	init:function(){
		update(this.url,this.filter);
	},
	
	update:function(url,filter){
		this.url = url;
		this.filter = filter;
		var me = this;
		var url = encodeURI(url);
	  	var queryInfo = encodeURI(JSON.stringify(filter));
		$.post(
		 	url,
		 	{
		 		 method : "query",
		 		 queryInfo : queryInfo
		 	},
		 	function(response){
		 		me.addResultToMap(response);
		 	}
		 );
	},
	
	addResultToMap:function(data){
		alert(data);
	}
}